/* 封装和用户相关的所有的接口 */
import axios from '@/utils/request'
// 封装了登录请求
export function reqLogin (mobile, code) {
  return axios({
    url: '/mp/v1_0/authorizations',
    method: 'post',
    data: {
      mobile,
      code
    }
  })
}

// 封装获取用户信息的请求
export function reqUserInfo () {
  return axios({
    method: 'get',
    url: '/mp/v1_0/user/profile'
  })
}

export function reqFans (params) {
  return axios({
    method: 'GET',
    url: '/mp/v1_0/followers',
    params
  })
}
// 修改个人信息
export function updateUserInfo (data) {
  return axios({
    method: 'PATCH',
    url: '/mp/v1_0/user/profile',
    data
  })
}

export function updateImage (fd) {
  return axios({
    method: 'PATCH',
    url: '/mp/v1_0/user/photo',
    data: fd
  })
}
